import React from 'react';
import { Icon } from 'antd-mobile';
import { history } from 'umi';

import './index.less';

export default function ListItem({ item, type }) {
  return (
    <div
      className="caEntp_item"
      onClick={() =>
        history.push({
          pathname: '/caEntp/detail',
          query: { id: item.companyId },
        })
      }
    >
      <div className="item_1">
        <div>{item.companyName}</div>
        <div>
          <Icon type="right" />
        </div>
      </div>
      <div className="item_2">
        {type === '0' ? (
          <>
            <div>运输类别：{item.transportCategoryCN}</div>
            <div>
              运输类型：
              {item.transportCategory === '01'
                ? item.natTransportTypeCN
                : item.coldTransportTypeCN}
            </div>
          </>
        ) : (
          <>
            <div>仓储类别：{item.storeCategoryCN}</div>
            <div>
              仓储类型：
              {item.storeCategory === '01'
                ? item.natStoreTypeCN
                : item.coldStoreTypeCN}
            </div>
          </>
        )}
      </div>
    </div>
  );
}
